package Test_1016;

import javax.security.auth.login.Configuration;
import java.io.*;


public class Test_1016 {
    public static void main(String[] args) throws FileNotFoundException{
        FileReader file=new FileReader("test.txt");
    }
    public static void main5(String[] args) throws ArithmeticException{
        System.out.println(10/0);
    }
    //编译时异常：
    public static void main4(String[] args) throws FileNotFoundException{
        try{
            FileReader file=new FileReader("test.txt");
        }catch(FileNotFoundException e){
            System.out.println("buhuo");
        }finally {
            System.out.println("finally" );
        }
    }
    public static void main3 (String[] args) throws ArithmeticException{
        System.out.println(10/0);
    }
    public static void main1(String[] args) {
        try{
            System.out.println(10/0);
        }catch(ArrayIndexOutOfBoundsException e){
            System.out.println("捕获异常");
        }finally{
            throw new ArithmeticException();
        }
    }
    public static void main2(String[] args) {
        try{
            System.out.println(10/0);
        }catch(ArithmeticException e){
            System.out.println("捕获异常");
        }finally{
            System.out.println("执行finally");
            throw new ArithmeticException();
        }
    }
}
